#!/usr/bin/env python

import time



def start_transaction():
    log_line = time.strftime("[%Y-%m-%d %H:%M:%S]", time.localtime()) +\
               ' Transaction starts'
    print(log_line)


def end_transaction():
    log_line = time.strftime("[%Y-%m-%d %H:%M:%S]", time.localtime()) +\
               ' Transaction ends'
    print(log_line)


def main():
    while True:
        start_transaction()
        time.sleep(2)
        end_transaction()
        time.sleep(1)


if __name__ == '__main__':
    main()
